#!/bin/bash

size=`stat -f "%z" "/Applications/Utilities/System Information.app/Contents/Resources/SystemLogo.tiff"`

system_profiler -detailLevel mini SPHardwareDataType SPAudioDataType SPNetworkDataType SPExtensionsDataType SPDisplaysDataType SPPCIDataType SPSoftwareDataType SPUSBDataType SPBluetoothDataType SPCameraDataType SPCardReaderDataType SPEthernetDataType SPFireWireDataType SPHardwareRAIDDataType SPNVMeDataType SPParallelSCSIDataType SPPowerDataType SPSASDataType SPSerialATADataType SPThunderboltDataType SPAirPortDataType -xml > /tmp/SystemProfiler.spx

#/usr/libexec/PlistBuddy -c "Set 0:_items:0:serial_number XXXXXXXXXXXX" SystemProfiler.spx 

#if [[ $size = 152162 ]] & [[ $size = 84122 ]]; then
#zip ~/Desktop/hf_result.zip SystemProfiler.spx
#else
#/usr/libexec/PlistBuddy -c "Set 0:_items:0:SMC_version_system Distro!" SystemProfiler.spx
#zip ~/Desktop/hf_result.zip SystemProfiler.spx
#fi

if [ -f /System/Library/LaunchDaemons/Niresh* ]; then
/usr/libexec/PlistBuddy -c "Set 0:_items:0:SMC_version_system Distro!" /tmp/SystemProfiler.spx
zip -j ~/Desktop/hf_result.zip /tmp/SystemProfiler.spx
else
zip -j ~/Desktop/hf_result.zip /tmp/SystemProfiler.spx
fi

rm /tmp/SystemProfiler.spx

pkill Pashua "HF Sysinfo"